import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

export const routes: Array<RouteRecordRaw> = [
    {
        path: "/:pathMath(.*)",
        redirect: "/index"
    },
    {
        path: "/",
        component: () => import('@/layout/index.vue'),
        redirect: '/index',
        children: [
            {
                path: '/index',
                name: 'index',
                component: () => import('@/views/home/index.vue'),
                meta: {
                    title: "menu.index"
                }
            },
            {
                path: '/information',
                name: 'information',
                component: () => import('@/views/information/index.vue'),
                meta: {
                    title: "menu.information"
                }
            },
            {
                path: '/digitalCurrencyMarket',
                name: 'digitalCurrencyMarket',
                component: () => import('@/views/digitalCurrencyMarket/index.vue'),
                meta: {
                    title: "menu.digitalCurrencyMarket"
                }
            }, {
                path: '/digitalCurrencyInformation',
                name: 'digitalCurrencyInformation',
                component: () => import('@/views/digitalCurrencyInformation/index.vue'),
                meta: {
                    title: "menu.digitalCurrencyInformation"
                }
            },
            {
                path: '/invest',
                name: 'invest',
                component: () => import('@/views/invest/index.vue'),
                meta: {
                    title: "menu.invest"
                }
            },
            {
                path: '/game',
                name: 'game',
                component: () => import('@/views/game/index.vue'),
                meta: {
                    title: "menu.game"
                }
            }, {
                path: '/mining',
                name: 'mining',
                component: () => import('@/views/mining/index.vue'),
                meta: {
                    title: "menu.mining"
                }
            }, {
                path: '/swap',
                name: 'swap',
                component: () => import('@/views/swap/index.vue'),
                meta: {
                    title: "menu.swap"
                }
            }, {
                path: '/user',
                name: 'user',
                component: () => import('@/views/user/index.vue'),
                meta: {
                    title: "menu.user"
                }
            }, {
                path: '/rechargeCoins',
                name: 'rechargeCoins',
                component: () => import('@/views/rechargeCoins/index.vue'),
                meta: {
                    title: "menu.rechargeCoins",
                    isBar: true
                }
            }, {
                path: '/withdrawCoins',
                name: 'withdrawCoins',
                component: () => import('@/views/withdrawCoins/index.vue'),
                meta: {
                    title: "menu.withdrawCoins",
                    isBar: true
                }
            }, {
                path: '/transfer',
                name: 'transfer',
                component: () => import('@/views/transfer/index.vue'),
                meta: {
                    title: "menu.transfer",
                    isBar: true
                }
            }, {
                path: '/getInvestList',
                name: 'getInvestList',
                component: () => import('@/views/getInvestList/index.vue'),
                meta: {
                    title: "menu.getInvestList",
                    isBar: true
                }
            }, {
                path: '/earningsRecord',
                name: 'earningsRecord',
                component: () => import('@/views/earningsRecord/index.vue'),
                meta: {
                    title: "menu.earningsRecord",
                    isBar: true
                }
            }, {
                path: '/leader',
                name: 'leader',
                component: () => import('@/views/leader/index.vue'),
                meta: {
                    title: "menu.leader",
                }
            },
        ]
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
